package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.Card
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.ICardListView
import de.baumann.browser.model.CardModel

class CardListPresenter : BasePresenter<ICardListView>() {
    fun getCardList() {
        CardModel().getCards()
                .subscribe(object : OdinObserver<List<Card>>(view) {
                    override fun onSuccess(data: List<Card>?) {
                        if (data==null){
                            return
                        }
                        view.setCards(data)
                    }
                })
    }
}